const mongoose = require('mongoose');

var merchantSchema = mongoose.Schema({
    // use for login
    username: String,
    password: String,
    //merchant name, use for show
    name:String, 
    idCard: String,
    portrait: String,
    address: String,
    status:String,
    reason:String,
    foods: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Food' }],
    orderInfos: [{ type: mongoose.Schema.Types.ObjectId, ref: 'orderInfo' }]
},{collection:'merchant'} );

var Merchant = mongoose.model('Merchant',merchantSchema);

module.exports = Merchant;